<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/4/20/020
 * Time: 15:45
 */

namespace app\index\interfaceIn;


use app\Lib\Exception\BlException;
use app\Lib\InterfaceIn\Api\Api;
use app\Lib\Ioc\User\UserBase;

class checkWeiXinUser extends Common implements Api
{
    /**
     *
     * @return bool
     * @throws BlException
     */
    public function handle()
    {
        $this->check();
        $result = (new UserBase())->checkWeiXinUser($this->param->postData);
        return $this->returnCreate($result);
    }

    /**
     * @return bool
     * @throws BlException
     */
    public function check()
    {
        $data = $this->param->postData;
        if(!isset($data['openId']) || empty($data['openId'])){
            throw new BlException('参数错误');
        }
        return true;
    }

}